<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/','Controller@test');

Route::get('/articleDetail','Controller@articleDetail');


Route::get('/admin','AdminController@index');

Route::get('/adminManage','AdminController@admin');

Route::get('/admin/getAllAdmin','AdminController@getAllAdmin');

Route::get('/addAdmin','AdminController@addAdmin');

Route::post('/saveAdmin','AdminController@saveAdmin');

Route::post('/deleteAdmin','AdminController@deleteAdmin');

Route::get('/updateAdmin','AdminController@updateAdmin');

Route::post('/doUpdateAdmin','AdminController@doUpdateAdmin');



Route::get('/userManage','AdminController@user');

Route::get('/admin/getAllUser','AdminController@getAllUser');

/*Route::get('/addUser','AdminController@addUser');

Route::post('/saveUser','AdminController@saveUser');*/

Route::post('/deleteUser','AdminController@deleteUser');

/*Route::get('/updateUser','AdminController@updateUser');

Route::post('/doUpdateUser','AdminController@doUpdateUser');*/



Route::get('/teacherManage','AdminController@teacher');

Route::get('/admin/getAllTeacher','AdminController@getAllTeacher');

/*Route::get('/addUser','AdminController@addUser');

Route::post('/saveUser','AdminController@saveUser');*/

Route::post('/deleteTeacher','AdminController@deleteTeacher');

/*Route::get('/updateUser','AdminController@updateUser');

Route::post('/doUpdateUser','AdminController@doUpdateUser');*/


Route::get('/questionManage','AdminController@question');

Route::get('/admin/getAllQuestion','AdminController@getAllQuestion');

/*Route::get('/addUser','AdminController@addUser');

Route::post('/saveUser','AdminController@saveUser');*/

Route::post('/deleteQuestion','AdminController@deleteQuestion');

/*Route::get('/updateUser','AdminController@updateUser');

Route::post('/doUpdateUser','AdminController@doUpdateUser');*/


Route::get('/replyManage','AdminController@reply');

Route::get('/admin/getAllReply','AdminController@getAllReply');

/*Route::get('/addUser','AdminController@addUser');

Route::post('/saveUser','AdminController@saveUser');*/

Route::post('/deleteReply','AdminController@deleteReply');

/*Route::get('/updateUser','AdminController@updateUser');

Route::post('/doUpdateUser','AdminController@doUpdateUser');*/



Route::get('/testEditor','AdminController@testEditor');
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web']], function () {
    //
});

Route::group(['middleware' => 'web'], function () {
    Route::auth();

    Route::get('/home', 'HomeController@index');
});

/*
 * auto
 */
Route::get('/home',function (){
    return view('home');
});


/*
 * 用户路由
 */

Route::post('/addUser','UserController@addUser');

Route::post('/checkUser','UserController@checkUser');


/*
 * 教师路由
 */

Route::post('/addTeacher','TeacherController@addTeacher');

Route::post('/checkTeacher','TeacherController@checkTeacher');


/*
 *问题路由
 */

Route::post('/addQuestion','QuestionController@addQuestion');

Route::get('/getAllQuestions','QuestionController@getAllQuestions');

Route::get('/getOneQuestion','QuestionController@getOneQuestion');

Route::post('/save','QuestionController@save');

/*
 *回答路由
 */
Route::post('/addReply','ReplyController@addReply');

Route::get('/getAllReplysById','ReplyController@getAllReplysById');
